home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_16385.txt < prev    next >
Text File  |  1989-02-26  |  949b  |  41 lines

  1. -- card: 16385 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 2202
  5. -- name: FileAtRoot
  6.  
  7.  
  8. -- part contents for background part 10
  9. ----- text -----
  10. 4
  11.  
  12. -- part contents for background part 2
  13. ----- text -----
  14. --
  15. -- FileAtRoot: a function that determines if a file is present at
  16. -- the root of a volume (i.e. not buried in a folder somewhere).
  17. --
  18. function FileAtRoot name
  19.   put NumberOfChars(":",name) into colonCount
  20.   if colonCount is 0 then
  21.     -- No colon in filename, needs expanding before calling this
  22.     -- function!
  23.     return false
  24.   end if
  25.   
  26.   -- At least 1 colon. If there's more it's not at the root
  27.   if colonCount is 1 then
  28.     -- If the file exists, it's at the root.
  29.     if FileModDate(name,true) is not empty then -- empty = file not fnd.
  30.       return true
  31.     else
  32.       return false
  33.     end if
  34.   else
  35.     return false
  36.   end if
  37. end FileAtRoot
  38.  
  39. -- part contents for background part 3
  40. ----- text -----
  41. FileAtRoot